﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using FindIt.BLL;
using MySql.Data.MySqlClient;
using FindIt.DAL;

namespace FindIt.UI.Pages
{
    public partial class FileStats : System.Web.UI.Page
    {
        //private MySqlConnection conn;
        //private MySqlCommand cmd;

        protected void Page_Load(object sender, EventArgs e)
        {
            //conn = new MySqlConnection(ConfigurationManager.AppSettings["connectionString"]);
            //cmd = new MySqlCommand();
            //cmd.Connection = conn;
            //conn.Open();

            ////still have to set the url to the file that was clicked on
            ////cmd.Parameters.Add("@url", MySqlDbType.VarChar).Value = url;    
            //string uploadDate, uploader, numViews, lastAccess, numComp = null;\

            //still have to set the url to the file that was clicked on
            //cmd.Parameters.Add("@url", MySqlDbType.VarChar).Value = url;    
            //string uploadDate = null, uploader = null, numViews = null, lastAccess = null;

            //cmd.CommandText = "SELECT UploadDate FROM tblWebPage WHERE URL=@url";
            //MySqlDataReader dr = cmd.ExecuteReader();                
            //if (dr.Read())
            //{
            //    uploadDate = (string)dr[0];
            //}
            //dr.Close();
            //txtDate.Text = uploadDate;

            //cmd.CommandText = "SELECT Owner FROM tblWebPage WHERE URL=@url";
            //MySqlDataReader dr2 = cmd.ExecuteReader();
            //if (dr.Read())
            //{
            //    uploader = (string)dr2[0];
            //}
            //dr2.Close();
            //txtDate.Text = uploader;
            
            //cmd.CommandText = "SELECT NumViews FROM tblWebPage WHERE URL=@url";
            //MySqlDataReader dr3 = cmd.ExecuteReader();
            //if (dr.Read())
            //{
            //    numViews = (string)dr3[0];
            //}
            //dr3.Close();
            //txtViews.Text = numViews;

            //cmd.CommandText = "SELECT LastViewed FROM tblWebPage WHERE URL=@url";
            //MySqlDataReader dr4 = cmd.ExecuteReader();
            //if (dr.Read())
            //{
            //    lastAccess = (string)dr4[0];
            //}
            //dr4.Close();
            //txtAccess.Text = lastAccess;

             
            //conn.Close();

        }
    }
 
}

